-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: Protocol tests set their own AWS credentials #1784
Conversation
@@ -118,7 +118,6 @@ jobs: | |||
set -o pipefail && \ | |||
NSUnbufferedIO=YES xcodebuild \ | |||
-scheme aws-sdk-swift-protocol-tests-Package \ | |||
-testPlan ProtocolTestPlan \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This protocol test plan is deleted (see below). Its only purpose was to get credentials into Xcode test runs, now this is done in protocol test setup.
run: | | ||
echo "[default]" > ~/.aws/credentials | ||
echo "aws_access_key_id = test-key-id" >> ~/.aws/credentials | ||
echo "aws_secret_access_key = test-secret-access-key" >> ~/.aws/credentials |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code above is deleted since credentials are now provided statically at protocol test client creation.
@@ -12,6 +12,7 @@ import ClientRuntime | |||
import Smithy | |||
import SmithyTestUtil | |||
import XCTest | |||
import func SmithyTestUtil.dummyIdentityResolver |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The 4 tests below demonstrate the code changes to protocol tests.
The SmithyTestUtil.dummyIdentityResolver
function provides a static identity resolver with some dummy AWS credentials.
signingRegion: "us-west-2", | ||
idempotencyTokenGenerator: ProtocolTestIdempotencyTokenGenerator(), | ||
httpClientEngine: ProtocolTestClient() | ||
) | ||
let client = S3Client(config: config) | ||
|
||
let input = GetObjectInput( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The .xcscheme
and .xctestplan
files below are deleted because they are unnecessary.
- The
.xctestplan
was only used to inject credentials in environment vars, those credentials are now supplied via static identity resolver. - The
.xcscheme
is auto-generated by Xcode on demand, with all targets in the package included. Having a hard-coded.xcscheme
makes it necessary to add new tests to the scheme as they are added; this results in skipped tests if not done. Not a problem with the auto-generated scheme since it auto-generates for every test run. The auto-generated scheme has the same name as the now-deleted.xcscheme
file, so no change to scheme name where it is referenced.
Description of changes
Companion
smithy-swift
PR: smithy-lang/smithy-swift#837Simplifies protocol test config to accompany the changes in
smithy-swift
. This PR also includes code-generation changes.smithy-swift
PR..xcscheme
and.xctestplan
for protocol tests are deleted, since they served no purpose other than to facilitate credentials provided through env vars.New/existing dependencies impact assessment, if applicable
No new dependencies were added to this change.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.